<?php

{{ builderInfo.php|raw }}

$config['appNamespace']                  = '{{ ConfigApp.appNamespace }}';

// session
$config['sessionSalt']                   = '{{ ConfigApp.sessionSalt }}';

// dirs & urls
$config['dir']                           = realpath(__DIR__ . '/..');
$config['srcDir']                        = realpath(__DIR__ . '/../src');
$config['logDir']                        = realpath(__DIR__ . '/../log');
$config['tmpDir']                        = realpath(__DIR__ . '/../tmp');
$config['widgetsDir']                    = realpath(__DIR__ . '/../src/Widgets');
$config['uploadDir']                     = realpath(__DIR__ . '/../{{ ConfigApp.uploadDir ?? 'upload' }}');
$config['uploadUrl']                     = '//' . ($_SERVER['HTTP_HOST'] ?? '') . $config['rewriteBase'] . '{{ ConfigApp.uploadDir ?? 'upload' }}';

// brand
$config['brand']['title']                = '{{ ConfigApp.brand.title }}';
$config['brand']['headline']             = '{{ ConfigApp.brand.headline }}';
$config['brand']['favicon']              = {% if ConfigApp.brand.favicon %}'{{ ConfigApp.brand.favicon }}'{% else %}$config['url'] . '/src/Assets/images/favicon.png'{% endif %};
$config['brand']['login']['splash']      = $config['url'] . '/src/Assets/images/{{ ConfigApp.brand.loginScreenImage ?? 'login-screen.jpg' }}';
$config['brand']['sidebar']['icon']      = $config['url'] . '/src/Assets/images/{{ ConfigApp.brand.sidebar.icon ?? 'logo.png' }}';
$config['brand']['sidebar']['iconUrl']   = '{{ ConfigApp.brand.sidebar.iconUrl ?? '' }}';
$config['brand']['sidebar']['title']     = '{{ ConfigApp.brand.sidebar.title ?? '' }}';

// widgets
$config['widgets'] = {{ varExport(configWidgetsEnabled)|raw }};

// web
// $config['web']['themeDir'] = realpath(__DIR__ . '/../src/Web/Theme');

// misc
$config['defaultController'] = '{% if ConfigApp.defaultController == '' %}Desktop{% else %}{{ ConfigApp.defaultController }}{% endif %}';
$config['availableLanguages'] = {% if ConfigApp.availableLanguages %}{{ varExport(ConfigApp.availableLanguages)|raw }}{% else %}['sk']{% endif %};
$config['userRoles'] = {% if ConfigApp.userRoles %}{{ varExport(ConfigApp.userRoles)|raw }}{% else %}[]{% endif %};
$config['skin'] = '{{ ConfigApp.skin ?? blue }}';

$config['coreClasses'] = [
  'Core\\Permissions' => \{{ ConfigApp.appNamespace }}\Core\Permissions::class,
  'Core\\Router' => \{{ ConfigApp.appNamespace }}\Core\Router::class,
  'Core\\Controller' => \{{ ConfigApp.appNamespace }}\Core\Controller::class,
  'Models\\User' => \{{ ConfigApp.appNamespace }}\Models\User::class,
  'Models\\UserRole' => \{{ ConfigApp.appNamespace }}\Models\UserRole::class,
  'Models\\UserHasRole' => \{{ ConfigApp.appNamespace }}\Models\UserHasRole::class,
  'Controllers\\Desktop' => \{{ ConfigApp.appNamespace }}\Controllers\Desktop::class,
// Uncomment these lines if you want to override another core classes
//   'Core\\Console' => \{{ ConfigApp.appNamespace }}\Core\Console::class,
//   'Core\\Locale' => \{{ ConfigApp.appNamespace }}\Core\Locale::class,
//   'Core\\TwigLoader' => \{{ ConfigApp.appNamespace }}\Core\TwigLoader::class,
//   'Core\\UserNotifications' => \{{ ConfigApp.appNamespace }}\Core\UserNotifications::class,
//   'Core\\Email' => \{{ ConfigApp.appNamespace }}\Core\Email::class,
//   'Models\\User' => \{{ ConfigApp.appNamespace }}\Models\User::class,
//   'Core\\ViewWithController' => \{{ ConfigApp.appNamespace }}\Core\ViewWithController::class,
];

{% if ConfigApp.smtp %}
// SMTP server
$config['smtp']['host'] = '{{ ConfigApp.smtp.host }}';
$config['smtp']['port'] = '{{ ConfigApp.smtp.port }}';
$config['smtp']['login'] = '{{ ConfigApp.smtp.login }}';
$config['smtp']['password'] = '{{ ConfigApp.smtp.password }}';
$config['smtp']['protocol'] = '{{ ConfigApp.smtp.protocol }}';
$config['smtp']['from'] = '{{ ConfigApp.smtp.from }}';
{% endif %}
